<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-07-19 09:21
 *
 * Version: 2.0
 */

namespace App\Modules\Member\Validators;


use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class MemberCoinValidator extends LaravelValidator
{
	protected $rules = [
		ValidatorInterface::RULE_CREATE => [
			'member_id'   => 'sometimes|required|numeric',
			'store_id'  => 'sometimes|required|numeric',
			'coin'      => 'sometimes|required|numeric',
			'coin_date' => 'sometimes|required|numeric',
		]
	];
	protected $messages = [
		'user_id.required'   => '用户id不能为空',
		'user_id.numeric'    => '格式不对，必须为数字',
		'store_id.required'  => '店铺id不能为空',
		'store_id.numeric'   => '格式不对，必须为数字',
		'coin.numeric'       => '格式不对，必须为数字',
		'coin.required'      => '积分数，不能为空',
		'coin_date.required' => '积分日期,不能为空',
		'coin_date.numeric'  => '积分日期格式不对，必须为时间戳'
	];
}